package ru.evga.inse.server.gwt.user.client.menu;

import ru.evga.gwt.lib.common.client.place.PlaceImpl;
import ru.evga.gwt.lib.common.client.place.PlaceParamMap;

public class MenuPlaceUtil
{
    public static final String KEY_MAIN_MENY = "MM";

    static public PlaceImpl.PlaceImplBuilder getBuilderForMenu(MenuItem item)
    {
        PlaceImpl.PlaceImplBuilder b = new PlaceImpl.PlaceImplBuilder();
        b.add(KEY_MAIN_MENY, item.toString());
        return b;
    }
    
    static public MenuItem getMenuItem(PlaceParamMap placeParamMap)
    {
        return MenuItem.valueOf(placeParamMap.get(KEY_MAIN_MENY));
    }
}
